package net.easyjava.third.rongcloud.rong.models;

import com.alibaba.fastjson.JSONObject;
import net.easyjava.third.rongcloud.rong.constants.RongCloudConstants;
import net.easyjava.tools.BaseBean;

//对server sdk返回的封装
public class SdkHttpResult extends BaseBean {

	private int code;
	private String result;

	public SdkHttpResult(int code, String result) {
		this.code = code;
		this.result = result;
	}

	public JSONObject getResultJson(){
		return JSONObject.parseObject(this.result);
	}

	/**
	 * 错误
	 * @return
	 */
	public boolean isError(){
		return RongCloudConstants.CODE_SUCCESS != this.code;
	}

	public int getHttpCode() {
		return code;
	}

	public String getResult() {
		return result;
	}

}
